
package jpoco.client;

public class Address implements java.io.Serializable
{
	private String formatted;
	private String streetAddress;
	private String locality;   // aka city
	private String region;     // aka state
	private String postalCode; // aka zip code
	private String country;
	private String type;
	private boolean primary = false;
	
	public Address()
	{
		super();
	}

	public String getFormatted()
	{
		return formatted;
	}

	public void setFormatted(String f)
	{
		this.formatted = f;
	}

	public String getStreetAddress()
	{
		return streetAddress;
	}

	public void setStreetAddress(String s)
	{
		this.streetAddress = s;
	}

	public String getLocality()
	{
		return locality;
	}

	/**
	 * 
	 * locality (aka city)
	 * 
	 * @param loc
	 * 
	 */
	public void setLocality(String loc)
	{
		this.locality = loc;
	}

	public String getRegion()
	{
		return region;
	}

	/**
	 * 
	 *  region (aka state)
	 *  
	 *  @param r
	 */
	public void setRegion(String r)
	{
		this.region = r;
	}

	public String getPostalCode()
	{
		return postalCode;
	}

	public void setPostalCode(String pc)
	{
		this.postalCode = pc;
	}

	public String getCountry()
	{
		return country;
	}

	public void setCountry(String c)
	{
		this.country = c;
	}
	

	public String getType()
	{
		return type;
	}

	public void setType(String t)
	{
		this.type = t;
	}

	public boolean isHome()
	{
		return "home".equalsIgnoreCase(this.getType());
	}
	
	public boolean isWork()
	{
		return "work".equalsIgnoreCase(this.getType());
	}
	
	public String toString()
	{
		return String.valueOf(this.getFormatted());
	}

	public boolean isPrimary()
	{
		return primary;
	}

	public void setPrimary(boolean b)
	{
		this.primary = b;
	}
	
}
